const fs = require('fs')
const files = fs.readdirSync(__dirname).filter(file => file !== 'index.js')

const ws = {
    run(server){
        for (const file of files) {
            if (file.toLowerCase().endsWith('js')) {
                const service = require(`./${file}`)
                service.run(server)
            }
        }
    }
}

module.exports = ws
